/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    ListView,
    TouchableOpacity
} from 'react-native';

var LazyFindCell =require('./LazyFindCell');
var dataAttr = require('../../../LocalData/findData.json');
var LazyFindList = React.createClass({
    getInitialState(){
        var ds = new ListView.DataSource({rowHasChanged:(row1, row2) => row1 !== row2});

        return{
            dataSource: ds.cloneWithRows(dataAttr)
        }
    },
    render() {
        return (
            <ListView
                dataSource={this.state.dataSource}
                renderRow={this.renderRows}
                style={{marginBottom:60}}
            />
        );
    },
    // 具体的cell
    renderRows(rowdata,sectionID,rowID){
        return(
            <View>
                <LazyFindCell
                    image={rowdata.image}
                    avatar={rowdata.avatar}
                    userName={rowdata.userName}
                    phoneNumber={rowdata.phoneNumber}
                />
            </View>
        );
    }
});
const styles = StyleSheet.create({
    container: {
        flex:1
    },
});
module.exports = LazyFindList;